package com.kl.listen;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.util.Arrays;

@Component
public class MyCommandLineRunner implements CommandLineRunner {

    @Autowired
    private TestClass testClass;

    @Override
    public void run(String... args) throws Exception {
        System.out.println("测试CommandLineRunner接口");
        System.out.println("参数列表 = " + Arrays.toString(args));
        testClass.print("张三");
    }
}
